package org.darkforest.init;


import org.darkforest.common.services.SettingService;

import org.darkforest.vo.SiteSettingInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;

/**
 * Created by valentina on 17/7/22.
 */
@Service
public class SystemConstantInit implements ServletContextAware {

    Logger logger = LoggerFactory.getLogger(SystemConstantInit.class);

    @Autowired
    private SettingService settingService;

    @Override
    public void setServletContext(ServletContext application) {
        SiteSettingInfo siteSettingInfo = new SiteSettingInfo();
        //读取数据库配置加载到对象
        settingService.initSiteSetting(siteSettingInfo);
    }
}
